---
- name: Determine if project already exists
  command: oc get project {{app}}
  register: project_exists
  failed_when: false
  changed_when: "'not found' in project_exists.stderr"

- name: project.yml
  when: "'not found' in project_exists.stderr"
  include_role:
    name: openshift/object
  vars:
    template_fullpath: "{{roles_path}}/openshift/project/templates/project.yml"

- name: deployer.yml
  include_role:
    name: openshift/object
  vars:
    template_fullpath: "{{roles_path}}/openshift/project/templates/deployer.yml"

- name: imagebuilder.yml
  include_role:
    name: openshift/object
  vars:
    template_fullpath: "{{roles_path}}/openshift/project/templates/imagebuilder.yml"

- name: imagepuller.yml
  include_role:
    name: openshift/object
  vars:
    template_fullpath: "{{roles_path}}/openshift/project/templates/imagepuller.yml"

- name: role-appowners.yml
  include_role:
    name: openshift/object
  vars:
    template_fullpath: "{{roles_path}}/openshift/project/templates/role-appowners.yml"

- name: appowners.yml
  include_role:
    name: openshift/object
  vars:
    template_fullpath: "{{roles_path}}/openshift/project/templates/appowners.yml"
